public class Main {

    //书法与篮球
    public static void main(String[] args) {
        int[] ds = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        int[] ct = {13,1,2,3,5,4,4,2,2,2};
        int ans = 0;
        for (int y = 2000; y <= 2024 ; y++) {//遍历年
            for (int m = 1; m <= 12; m++) {//遍历月
                int D = ds[m];
                if(m == 2){
                    if(y % 4 == 0 && y % 100 != 0 || y % 400 == 0){
                        D = 29;
                    }
                }
                for (int d = 1; d <= D ; d++) {//遍历日
                    if(y == 2024 && m == 4 && d == 13){
                        System.out.println(ans);
                        return ;
                    }
                    int x = y * 10000 + m * 100 + d;
                    int b = 0;
                    int count = 0;
                    while(x > 0){
                        b = x % 10;
                        count += ct[b];
                        x /= 10;
                    }
                    if(count > 50){
                        ans++;
                    }
                }

            }
        }
        System.out.println(ans);
    }

}
